![]() |
PATH![]() |
Returns the version of JManager available on the host computer.
UInt32 JMGetVersion (void);
A version of JManager older than the one your embedding application compiled against may not have the same functionality; you can use JMGetVersion and compare the result against kJMVersion to avoid calling nonexisting functions.
Returns the version of Mac OS Runtime for Java (MRJ) installed on the host computer.
UInt32 JMGetMRJRuntimeVersion ();
function result The version of MRJ currently installed. This four-byte value has the same form as a NumVersion structure, which is the first four bytes of a resource of type 'vers' .
Converts a Mac OS file system specification record ( FSSpec ) into a Uniform Resource Locator (URL) string.
Handle JMFSSToURL (JMSessionRef session,
const FSSpec* spec);
The JMFSSToURL function resolves the path of the file represented by the file system specification record and returns this information as a URL string. The handle returned points to a null-terminated string. Your application is responsible for calling the Mac OS Toolbox function DisposeHandle to release the allocated handle.
The
JMURLToFSS
function.
Converts a Uniform Resource Locator (URL) into a Mac OS file system specification record ( FSSpec ).
OSStatus JMURLToFSS (JMSessionRef session,
const JMTextRef urlString,
FSSpec* spec);
The URL string must follow the format file:///disk/dir1/.../dirN/file . Other formats cause the function to return the result code paramErr .
The
JMFSSToURL
function.
Adds a directory, zip file, or Java archive (JAR) file to the class path.
OSStatus JMAddToClassPath (
JMSessionRef session,
const FSSpec* spec);
The JMAddToClassPath function adds an additional file to the Java class definition search path by appending a Mac OS file system specification record (FSSpec) to the class path of the current session. You can add any number of files to the class path. The FSSpec value can indicate an uncompressed zip file or a directory. A directory is considered to be the root of a class hierarchy.
Note
If you want to prepend a file to the class path, you should add it directly to the MRJClasses folder.
Returns the current JNIEnv data structure.
struct JNIEnv* JMGetCurrentEnv (JMSessionRef session);
The JMGetCurrentEnv function allows you to access the current Java Native Interface (JNI) structure. Once you have the JNIEnv structure, you can call JNI functions. The data structure JNIEnv is defined in the header file JNI.h .
You can find documentation for the Java Native Interface at the Web site
Note
Unless you have a particular reason to access the Java Runtime Interface, you should access the Java Native Interface, which provides similar functionality, instead.
You can find documentation for the Java Runtime Interface at the Web site
http://developer.netscape.com/
Returns the current JRIEnv data structure.
struct JRIEnv* JMGetCurrentJRIEnv (JMSessionRef session);
Note
Unless you have a particular reason to access the Java Runtime Interface, you should access the Java Native Interface, which provides similar functionality, instead.
You can find documentation for the Java Runtime Interface at the Web site
http://developer.netscape.com/
Converts a JRI-based jref to a JNI-based jobject .
jobject JMJRIRefToJNIObject (
JMSessionRef session,
JNIEnv* env,
jref jriRef);
If you want to use jref object references with the Java Native Interface (JNI), you must convert them to jobject references using JMJRIRefToJNIObject . Note that you must have a pointer to the current JNIEnv data structure before calling this function.
The
JMGetCurrentEnv
function.
Converts a JNI-based jobject to a JRI-based jref .
jref JMJNIObjectToJRIRef (
JMSessionRef session,
JNIEnv* env,
jobject jniObject);
If you want to use jobject object references with the Java Runtime Interface (JRI), you must convert them to jref references using JMJNIObjectToJRIRef. Note that you must have a pointer to the current JNIEnv data structure before calling this function.
The
JMGetCurrentEnv
function.
Maps a JNI-based JNIEnv to the owning AWT context, if one exists.
JMAWTContextRef JMJNIToAWTContext (
JMSessionRef session,
JNIEnv* env);
Note that you must have a pointer to the current JNIEnv data structure before calling this function.
The
JMGetCurrentEnv
function.
Adds the connection ID of a prepared fragment to the list of shared libraries used when searching for JNI (and JRI) native methods.
Boolean JMRegisterLibrary (
JMSessionRef session,
ConstStr63Param libraryName,
CFragConnectionID connID,
Boolean javaShouldClose);
The Java method System.loadLibrary does not reuse existing connections to shared libraries if they were instantiated by programs outside the Java environment. Instead, it creates an additional private copy of the shared library fragment for its own use. Doing so means that multiple instances of a library's data/TOC section may exist in memory. To override this problem, you can register an instantiated library with JManager using JMRegisterLibrary . Then, whenever calls to native methods are made using the Java Native Interface (JNI) or Java Runtime Interface (JRI), JManager will search the list of registered libraries before attempting to instantiate one.